{include file='common/head'}
<!--员工发布&#45;&#45;说天喊地-->
<div style="overflow-x: hidden;width: 96%;margin: auto;padding-top: 1rem;">
    <blockquote class="layui-elem-quote layui-text">
        <div class="demoTable layui-form">
            <!--<table class="layui-hide" id="LAY_table_user" lay-filter="user"></table>-->
            <div class="demoTable layui-form">
                <div class="layui-input-inline">
                    <select name="user_id"  lay-search>
                        <option value="">筛选所属用户</option>
                        {foreach $users as $v}
                        <option value="{$v.id}">{$v.user_name}</option>
                        {/foreach}
                    </select>
                </div>
                <div class="layui-input-inline">
                    <select name="status"  lay-search>
                        <option value="">筛选审核状态</option>
                        <option value="1">未审核</option>
                        <option value="2">审核未通过</option>
                        <option value="3">审核完成</option>
                    </select>
                </div>
                <button class="layui-btn " data-type="reload" ><i class="layui-icon">&#xe615;</i>搜索</button>
            </div>
        </div>
    </blockquote>
    <div class="demoTable layui-for">
        <table class="layui-table" lay-data="{height: 'full-150', url:'{:url('Check/getManufacturer')}',edit:true, page:true, id:'testReload',loading:true}" lay-filter="demo">
            <thead>
            <tr>
                <th lay-data="{field:'id',width:80,fixed: true,templet:'#id'}">编号</th>
                <th lay-data="{field:'user_name', width:200,templet: '#user_name'}">用户名称</th>
                <th lay-data="{field:'mobile', width:200,templet: '#mobile'}">手机号</th>
                <th lay-data="{field:'status', width:200,templet: '#status'}">审核状态</th>
                <th lay-data="{field:'update_time', width:200,templet: '#update_time'}">请求时间</th>
                <th lay-data="{fixed: '', width:200,fixed: 'right', align:'left', toolbar: '#barDemo'}">操作</th>
            </tr>
            </thead>
        </table>
        <script type="text/html" id="barDemo">
            <a title="详情" lay-event="info" href="#"><i class="layui-icon" style="font-size: 25px; color:#029587;line-height: 30px">&#xe642;</i></a>
            <!--<a title="删除" lay-event="del" href="#"><i class="layui-icon" style="font-size: 25px; color:#029587;line-height: 30px">&#xe640;</i></a>-->
        </script>
        <script type="text/html" id="id" lay-event="detail_content">
            <span>{{ d.id }}</span>
        </script>
        <script type="text/html" id="user_name" lay-event="detail_content">
            <span>{{ d.user_name }}</span>
        </script>
        <script type="text/html" id="update_time" lay-event="detail_content">
            <span>{{ d.update_time }}</span>
        </script>
        <script type="text/html" id="mobile" lay-event="detail_content">
            <span>{{ d.mobile }}</span>
        </script>
        <script type="text/html" id="status">
            {{#  if(d.status == 1){ }}
            <span style="color: #FF5722" >未审核</span>
            {{#  } }}
            {{#  if(d.status == 2){ }}
            <span style="color: #FF5722" >审核未通过</span>
            {{#  } }}
            {{#  if(d.status == 3){ }}
            <span style="color: #029587" >审核通过</span>
            {{#  } }}
        </script>
    </div>
    {include file='common/footer'}
    <!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
    <script>
        layui.use(['table','form'], function(){
            var table = layui.table
                ,form = layui.form;
            var $ = layui.$, active = {
                reload: function(){
                    var cate_name = $('input[name="cate_name"]').val();
                    var user_id = $('select[name="user_id"] option:checked').val();
                    var status = $('select[name="status"] option:checked').val();
                    //执行重载
                    table.reload('testReload', {
                        where: {
                            cate_name:cate_name,
                            user_id:user_id,
                            status:status
                        }
                    });
                }
            };

            $('.demoTable .layui-btn').on('click', function(){
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });

            //监听表格复选框选择
            table.on('checkbox(demo)', function(obj){
                console.log(obj)
            });
            //监听工具条
            table.on('tool(demo)', function(obj){
                var data = obj.data;
                if(obj.event === 'info'){
                    layer.open({
                        type: 2,
                        title: '详情',
                        shadeClose: true,
                        shade: false,
                        maxmin: true, //开启最大化最小化按钮
                        area: ['100%', '100%'],
                        content: '{:url("Check/getDetialPage")}?id='+data.id,
                        end: function () {
                            table.reload('testReload');
                        },
                    });
                }
            });

            // $('.addInfo').on('click',function(){
            //     layer.open({
            //         type: 2,
            //         title: '添加',
            //         shadeClose: true,
            //         shade: false,
            //         maxmin: true, //开启最大化最小化按钮
            //         area: ['50%', '50%'],
            //         content: '{:url("Order/cateModifyPage")}',
            //         end: function () {
            //             table.reload('testReload');
            //         },
            //     });
            // });
        });
    </script>
    </body>
    </html>